import { Shape } from "./classDemo";

class ShapeChild extends Shape{
    volume: number;

    constructor(public name: string, width: number, height: number, length: number){
        super(name, width, height);
        this.volume = length * this.area;
    };

    shoutOut() : string {
        return "I'm " + this.name +  " with a volume of " + this.volume + " cm cube.";
    }

    superOut() : string {
        return super.shoutOut();
    }
}

let cube : ShapeChild = new ShapeChild("lwyChild", 30, 30, 30);

setTimeout(() => {
    document.body.innerHTML = cube.shoutOut();
    document.body.innerHTML = cube.superOut();
}, 5000);